#ifndef MYINI_H
#define MYINI_H
/***
 * ini文件读取和写入类
 */

#include <QObject>
#include <QCoreApplication>
#include <QDir>
#include <QFile>
#include <QDebug>
#include <QSettings>

enum CAMERA
{
    _airMidWV = 0,
    _airVisble = 1,
    _groundLongWV = 2,
    _groundMidWV = 3
};

typedef struct _ENCODE_PARAM
{
    CAMERA _camera = _airMidWV;
    QString _srcIp = "";
    quint16 _srcPort = 0;
    QString _dstIp = "";
    quint16 _dstPort = 0;
    QString _bindIp = "";
    quint16 _bindPort = 0;
    int _fps = 0;
}ENCODE_PARAM;

class MyIni : public QObject
{
    Q_OBJECT
public:
    explicit MyIni(QObject *parent = nullptr);

    static void ensureConfigFile(); //确定文件存在，否则创建

    static QVector<ENCODE_PARAM> loadVideoConfigs();  //读取所有配置

    static ENCODE_PARAM loadVideoConfig(CAMERA camera);  //读取单个配置

private:
    static QString m_dir;

};

#endif // MYINI_H
